package date0809;

import java.util.InputMismatchException;
import java.util.Scanner;

public class homework0809 {
    public static void main(String[] args) {

        try {
            Scanner input =new Scanner(System.in);
            System.out.println("我想让你输五个整数，那你想输入几个？");
            int n=input.nextInt();

            int[] in=new int[5];
            for (int i = 0; i < n; i++) {
                System.out.println("请输入数字:");
                in[i]=input.nextInt();
                //in[i]=Integer.parseInt(temp[i]);
            }

            for (int i = 0; i < 5; i++) {
                System.out.println(in[i]+" ");
            }
        }catch (InputMismatchException e){
            System.out.println("请输入整数！");
        }
        catch (ArrayIndexOutOfBoundsException e){
            System.out.println("请输入不超过五个数字！");
        }
    }
}
